
package com.mt.api.modules.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
*
* @description /
* @author plover
* @date 2020-07-06
**/
@Data
@TableName("es_order")
public class AppOrder implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "订单号")
    private String orderNo;

    @ApiModelProperty(value = "订单时间")
    private Date orderTime;

    @ApiModelProperty(value = "完成时间")
    private Date finishTime;

    @ApiModelProperty(value = "客户id")
    private Integer customerId;

    @ApiModelProperty(value = "收件人")
    private String receiver;

    @ApiModelProperty(value = "收件人电话")
    private String rphone;

    @ApiModelProperty(value = "收件人地区")
    private String rarea;

    @ApiModelProperty(value = "收件人地址")
    private String raddress;

    @ApiModelProperty(value = "订单状态 0 未完成 1已完成 2已取消")
    private Integer status;

    @ApiModelProperty(value = "订单类型 1-销售单 2-销售退回单")
    private Integer type;

    @ApiModelProperty(value = "打印状态 0未打印 1已打印 2打印失败")
    private Integer printStatus;

    @ApiModelProperty(value = "送货地址")
    private String shippingAddress;

    @ApiModelProperty(value = "订单金额")
    private Integer amount;

    @ApiModelProperty(value = "订单总数量")
    private Integer qty;

    @ApiModelProperty(value = "出库数量")
    private Integer outStoreQty;

    @ApiModelProperty(value = "订单备注")
    private String remark;

    @ApiModelProperty(value = "结算状态 0-未结算 1-部分结算 2-结算完成")
    private Integer settleStatus;

    @ApiModelProperty(value = "结算金额")
    private Integer settleAmount;

    @ApiModelProperty(value = "是否删除 0-否 1-是")
    private Integer deleted;

    @TableField(fill = FieldFill.INSERT)
    private Integer createId;

    @TableField(fill = FieldFill.INSERT)
    private String creator;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateId;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updater;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    public void copy(AppOrder source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}